from django.urls import path
from .Views import login, logout, adminUser, ap1, phonemanger, ap2, inpark, urlmange, devices, cdzinfo, paymanage, tc
from app01.Views.netdev import dev, ports, logs
from app01.Views.abso import absoTotal, order_get, produce, mix_data, query_sql
from app01.Views.IDCDevice import device, client, idc_room, idc_Cabinet
from app01.Views.contract import contract, fileud
from django.conf import settings
from django.conf.urls.static import static


urlpatterns = [
    #登录接口
    path('api/login', login.User_Login.as_view()),
    path('api/logout', logout.User_Logout.as_view()),
    #管理员 用户管理接口
    path('api/admin/userlist', adminUser.AdminUser.as_view()),
    path('api/password/update', adminUser.Update_password_api.as_view()),
    #项目1 增删改查接口
    path('api/ap1', ap1.Ap1_api.as_view()),
    #项目1 excel上传和导出接口
    path('api/ap1/excel', ap1.Ap1_excel.as_view()),
    #项目2
    path('api/phonemange', phonemanger.phoneMange_api.as_view()),
    path('api/ap2', ap2.Ap2_api.as_view()),
    # path('api/ap2_select', ap2.Ap2_select_api.as_view()),
    path('api/inpark', inpark.InPark_api.as_view()),
    path('api/urlmange', urlmange.UrlSite_api.as_view()),

    path('api/device/<str:module>', devices.Device_Api.as_view()),
    path('api/cdzinfo/<str:module>', cdzinfo.CDZInfo_Api.as_view()),

    path('api/netdev/<str:module>', dev.NetDevice_Api.as_view()),
    path('api/ports/<str:module>', ports.PortsAPI.as_view()),
    path('api/logs/<str:module>', logs.LogsAPI.as_view()),

    path('api/absototal/<str:module>', absoTotal.AbsoTotal_Api.as_view()),
    path('api/abso/<str:module>', order_get.AbsoGetOrder_Api.as_view()),
    path('api1/abso_data/<str:module>', mix_data.DailyMetricsAPIView.as_view()),
    path('api2/abso_query', query_sql.ExternalSQLAPIView.as_view()),

    path('api/payment/<str:module>', paymanage.PayMent_Api.as_view()),

    path('api/tcinfo/<str:module>', tc.Tcinfo_Api.as_view()),

    path('api/produce/<str:module>', produce.Echarts_api.as_view()),

    path('api/idc_device/<str:module>', device.DeviceListView.as_view()),
    path('api/idc_client/<str:module>', client.ClientView.as_view()),
    path('api/idc_room/<str:module>', idc_room.MachRoomView.as_view()),
    path('api/idc_cabinet/<str:module>', idc_Cabinet.CabinetView.as_view()),

    path('api/contract/<str:module>', contract.Contract_Api.as_view()),

    path('api/imgles', fileud.ImgFileApi.as_view())

]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
